<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算属性</title>
</head>
<body>
    <div id="app">
        <!-- 这是调用方法 -->
        <p>times1:{{times1()}}</p>
        <!-- 这是调用属性， -->
        <p>times2:{{times2}}</p>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.5.21/dist/vue.min.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <script>
        var vm = new Vue({
        el:"#app",
        data:{
            message:"hello,Vue!"
        },
        methods:{
            times1:function(){
                return Date.now();
            }
        },
        computed:{//计算属性，computed和methods两种方法不能同名。
            times2:function(){
                return Date.now();
            }
        }
    });
    </script>
</body>
</html>